/* Include OCaml */
#include <caml/mlvalues.h>
#include <stdio.h>

value fact(value x)
{
    int tmp = 1;
    int v = Int_val(x);
    while (v > 0)
        tmp = tmp * (v--);
    return Val_int(tmp);
}
